<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var array=["2","22","222"];
        var newArray=[];
        for(var i=0;i<array.length;i++){
            var length=array[i].length;
            newArray[i]=length;
        }
        console.log(newArray);
    </script>
</body>
</html>